class Car():

  def __init__(self, make, model, year):
    self.make = make
    self.model = model
    self.year = year
    self.meter = 0

  def showInfo(self):
    print (str(self.year) + ' ' + str(self.make) + ' ' + str(self.model) + ' ' + str(self.meter) + '-km')

  def showMeter(self):
    print ('meter = ' + self.meter + '-km')

  def updateMeter(self, number):
    if number > self.meter:
      self.meter = number
      return self.meter
    else:
      print ('禁止回调公里数.')

  def incrementMeter(self, number):
    if number >= 0:
      self.meter += number
      return self.meter
    else:
      print ('禁止输入小于零的数字')

# ElectricCar extens Car
class ElectricCar(Car):

  def __init__(self, make, year, model):
    super().__init__(make, year, model)
    self.battery = 0
  
  def showInfo(self):
    print ('ElectricCar: ' + str(self.make) + ', ' + str(self.model) + ', ' + str(self.year) + '.')

  def showBatterySize(self):
    print ('Current battery size is: ' + str(self.battery) + '.')

  def updateBatterySize(self, num):
    if num >= 0:
      self.battery = num
      return self.battery
    else:
      print ('input number must greater than 0')
      return 'input number must greater than 0'
    
  def incrementBattery(self, num):
    if num >= 0:
      self.battery += num
      return self.battery
    else:
      print ('input number must greater than 0')
      return 'input number must greater than 0'
